﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NLBS.Data.Interface;
using NLBS.Entity;
namespace NLBS.Data.SqlDataService
{
    public class CategoryService : ICategoryService
    {
        private DbProvider db
        {
            get
            {
                return DbProvider.Instance();
            }
        }

        #region ICategoryService Members

        public IList<Category> GetCategory()
        {
            return db.GetCategory();
        }

        public Category GetCategoryByID(int catID)
        {
            return db.GetCategoryByID(catID);
        }

        public int InsertCategory(Category cat)
        {
            return db.InsertCategory(cat);
        }

        public void UpdateCategory(Category cat)
        {
            db.UpdateCategory(cat);
        }

        public void DeleteCategory(int catID)
        {
            db.DeleteCategory(catID);
        }

        public void MoveCategory(string catIDList, int newCatID)
        {
            db.MoveCategory(catIDList, newCatID);
        }

        public void UpdateCategoryCounter(int catID)
        {
            db.UpdateCategoryCounter(catID);
        }

        #endregion
    }
}
